import food
class shop(object):
    """description of class"""
    def __init__(self,name,tips,url,delivery_cost):
        self.name=name
        self.tips=tips
        self.url=url
        self.delivery_cost=delivery_cost
        self.foods=list()
        self.discounts=list()
        self.manjian=list()
    def add_food(self,name,price,packing_fee):
        self.foods.append(food.food(name,price,packing_fee))
    def print_manjian(self):
        print("{0:-^20}".format(self.name))
        for i in self.manjian:
            foodlist=''
            for j in i[0]:
                foodlist+=self.foods[j].name+'+'
            foodlist+="    满"+i[2][0]+"减"+i[2][1]
            foodlist+="    总额:"+str(i[1]-float(i[2][1]))
            foodlist+="    折扣:"+str((i[1]-float(i[2][1]))/i[1])
            print(foodlist)
        print("-"*20+'-'*len(self.name))
